package ciprian.google.location_mgr;

import android.location.Location;
import android.location.LocationManager;

/**
 * @author Ciprian Ursu
 * 
 *         This class describes a point on the map.
 * 
 */
public class MapPoint {
    public final static int POI_PEAK = 0;
    public final static int POI_HUT = 1;
    public final static int POI_SHELTER = 2;
    public final static int POI_CAMPING = 3;
    public final static int POI_NICE_TO_VIEW = 4;
    public final static int INTERMEDIATE_POINT = 5;

    protected int type;
    protected Location pointLocation;
    protected String pointName;

    public MapPoint(int type, Location location, String name) {
        this.type = type;
        this.pointLocation = location;
        this.pointName = name;
    }

    public MapPoint(int type, Location location) {
        this.type = type;
        this.pointLocation = location;
    }

    public MapPoint(int type, double latitude, double longitude, double altitude, long time,
            String name) {
        this.type = type;
        this.pointLocation = new Location(LocationManager.GPS_PROVIDER);
        this.pointLocation.setLatitude(latitude);
        this.pointLocation.setLongitude(longitude);
        this.pointLocation.setAltitude(altitude);
        this.pointLocation.setTime(time);
        this.pointName = name;
    }

    /**
     * @return the type
     */
    public int getType() {
        return type;
    }

    /**
     * @param type
     *            the type to set
     */
    public void setType(int type) {
        this.type = type;
    }

    /**
     * @return the latitude
     */
    public double getLatitude() {
        return pointLocation.getLatitude();
    }

    /**
     * @param latitude
     *            the latitude to set
     */
    public void setLatitude(double latitude) {
        this.pointLocation.setLatitude(latitude);
    }

    /**
     * @return the longitude
     */
    public double getLongitude() {
        return pointLocation.getLongitude();
    }

    /**
     * @param longitude
     *            the longitude to set
     */
    public void setLongitude(double longitude) {
        this.pointLocation.setLongitude(longitude);
    }

    /**
     * @return the altitude
     */
    public double getAltitude() {
        return pointLocation.getAltitude();
    }

    /**
     * @param altitude
     *            the altitude to set
     */
    public void setAltitude(double altitude) {
        this.pointLocation.setAltitude(altitude);
    }

    /**
     * @return the time
     */
    public long getTime() {
        return pointLocation.getTime();
    }

    /**
     * @param time
     *            the time to set
     */
    public void setTime(long time) {
        this.pointLocation.setTime(time);
    }

    /**
     * @return the pointName
     */
    public String getPointName() {
        return pointName;
    }

    /**
     * @param pointName
     *            the pointName to set
     */
    public void setPointName(String pointName) {
        this.pointName = pointName;
    }

    /**
     * 
     * @return
     */
    public Location getLocation(){
        return pointLocation;
    }
    
    public void setLocation(Location l){
        this.pointLocation = l;
    }
}
